package com.baba.bracelet.dao;

import com.baba.bracelet.dto.output.EquipOutDTO;
import com.baba.bracelet.entity.EquipEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Select;

/**
 * @author wulongbo
 * @version 1.0
 * @date 2020/6/10 14:35
 * @description
 */
public interface EquipDao extends BaseMapper<EquipEntity> {
    /**
     * 查询所有设备的基础信息
     * @Author wulongbo
     * @CreateTime 2020/5/29 14:28
     * @Param  page  分页参数
     * @Return IPage<UserInfoEntity> 分页数据
     */
    @Select(" SELECT equip.imei,equip.imsi,equip.factory,equip.type,equip.operator,equip.create_time,state.battery,state.state\n" +
            " FROM tbl_equip as equip\n" +
            " LEFT JOIN tbl_equip_state as state on\n" +
            " equip.imei=state.imei")
    IPage<EquipOutDTO> selectEquipInfo(IPage<EquipOutDTO> page);
}
